home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form spkr_gui
- BorderStyle = 3 'Fixed Dialog
- Caption = "Speaker"
- ClientHeight = 1800
- ClientLeft = 4410
- ClientTop = 4485
- ClientWidth = 5250
- Icon = "spkr_gui.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1800
- ScaleWidth = 5250
- ShowInTaskbar = 0 'False
- Begin VB.CommandButton Exit_Button
- Caption = "Exit"
- Height = 375
- Left = 3840
- TabIndex = 7
- Top = 1200
- Width = 1095
- End
- Begin VB.CommandButton About_Button
- Caption = "About"
- Height = 375
- Left = 2040
- TabIndex = 6
- Top = 1200
- Width = 1095
- End
- Begin VB.TextBox duration
- Height = 285
- Left = 3840
- TabIndex = 5
- Text = "1000"
- Top = 600
- Width = 1095
- End
- Begin VB.TextBox frequency
- Height = 285
- Left = 3840
- TabIndex = 4
- Text = "440"
- Top = 120
- Width = 1095
- End
- Begin VB.CommandButton Tone_Button
- Caption = "Play Tone"
- Height = 375
- Left = 240
- TabIndex = 1
- Top = 360
- Width = 1095
- End
- Begin VB.CommandButton ChimeButton
- Caption = "Play Chime"
- Height = 375
- Left = 240
- TabIndex = 0
- Top = 1200
- Width = 1095
- End
- Begin VB.Label Label2
- Caption = "Duration (milliseconds)"
- Height = 255
- Left = 1800
- TabIndex = 3
- Top = 600
- Width = 1815
- End
- Begin VB.Label Label1
- Caption = "Frequency (Hertz)"
- Height = 255
- Left = 1800
- TabIndex = 2
- Top = 120
- Width = 1575
- End
- Begin VB.Line Line1
- X1 = 0
- X2 = 5280
- Y1 = 960
- Y2 = 960
- End
- Attribute VB_Name = "spkr_gui"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '////////////////////////////////////////////////////////////////
- '// File - spktGUI.frm - code
- '// This application plays a tone to the speaker, and is
- '// controlled via a graphical user interface
- '// The speaker is accessed directly on the motherboard, using
- '// WinDriver functions.
- '////////////////////////////////////////////////////////////////
- Dim hSPEAKER As SPEAKER_HANDLE
- ' show an about box
- Private Sub About_Button_Click()
- MsgBox "Speaker Sample v1.0" & Chr$(13) & Chr$(13) & _
- "This sample accesses the on-board speaker" & Chr$(13) _
- & " through the WinDriver's Visual Basic interface." _
- & Chr$(13) & Chr$(13) & "Copyright (c) 2001 Jungo" _
- , vbOKOnly, "About the Speaker Sample "
- End Sub
- ' play a simple chime
- Private Sub ChimeButton_Click()
- SPEAKER_Tone hSPEAKER, 440, 400
- SPEAKER_Tone hSPEAKER, 329, 200
- SPEAKER_Tone hSPEAKER, 1, 10
- SPEAKER_Tone hSPEAKER, 329, 200
- SPEAKER_Tone hSPEAKER, 369, 400
- SPEAKER_Tone hSPEAKER, 329, 800
- SPEAKER_Tone hSPEAKER, 415, 400
- SPEAKER_Tone hSPEAKER, 440, 600
- End Sub
- Private Sub Exit_Button_Click()
- SPEAKER_Close hSPEAKER
- Unload spkr_gui
- End Sub
- ' initialze and open a handle to the speaker
- Private Sub Form_Load()
- If (Not SPEAKER_Open(hSPEAKER)) Then
- MsgBox SPEAKER_ErrorString, vbOKOnly, "ERROR"
- End If
- End Sub
- ' play one tone
- Private Sub Tone_Button_Click()
- SPEAKER_Tone hSPEAKER, spkr_gui.frequency.Text, spkr_gui.duration.Text
- End Sub
-